package com.sky.controller.user;

import com.sky.dto.CategoryDTO;
import com.sky.dto.CategoryPageQueryDTO;
import com.sky.entity.Category;
import com.sky.result.PageResult;
import com.sky.result.Result;
import com.sky.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController("userCategoryController")
@RequestMapping("/user/category")
public class CategoryController {
    @Autowired
    CategoryService categoryService;

  //  根据类型查找
    @GetMapping("/list")
    public Result<List<Category>> list(Integer type){
        List<Category> list1 = categoryService.list(type);
        return Result.success(list1);
    }
}
